package arrayListExercises.basicPractice;

import java.util.ArrayList;
import java.util.Random;

/**
 * @author: bamboo_shoot
 * @date: 20/2/5 17:39
 * @description: 生成6个1~33之间的随机整数,添加到集合,并遍历
 */
public class AddData {
    public static void main(String[] args) {
        Random ra = new Random();
        ArrayList<Integer> numbers = new ArrayList<Integer>();
        for (int i = 0; i < 6; i++) {
            int num = ra.nextInt(33) + 1;
            numbers.add(num);
        }
        traversal(numbers);
    }

    private static void traversal(ArrayList<Integer> numbers) {
        for (Integer number : numbers) {
            System.out.println("number"+"-"+number);
        }
    }
}
